﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace ReportingServices.DeploymentCenter.Core.Logging
{
    public class Logger
    {
        #region Methods

        public static void LogError(string message)
        {
            Trace.TraceError(String.Format("{0} - {1}", DateTime.Now, message));
        }

        public static void LogError(Exception ex)
        {
            LogError(String.Format("{0}{1}{2}", ex.Message, Environment.NewLine, ex.StackTrace));
        }

        public static void LogInformation(string message)
        {
            Trace.TraceInformation(String.Format("{0} - {1}", DateTime.Now, message));
        }

        public static void LogInformation(Exception ex)
        {
            LogInformation(String.Format("{0}{1}{2}", ex.Message, Environment.NewLine, ex.StackTrace));
        }

        public static void LogWarning(string message)
        {
            Trace.TraceWarning(String.Format("{0} - {1}", DateTime.Now, message));
        }

        public static void LogWarning(Exception ex)
        {
            LogWarning(String.Format("{0}{1}{2}", ex.Message, Environment.NewLine, ex.StackTrace));
        }

        #endregion
    }
}
